// 目录存在时，清空，不存在时，新建
const fs = require("fs");
function createOrCleanDir(dirname, isDel) {
    if (fs.existsSync(dirname) && isDel) {
        // 删除之前的 model
        fs.rmSync(dirname, { recursive: true })
    }
    fs.mkdirSync(dirname, { recursive: true })
}

function upperCaseFirstLatter(name) {
    return name.charAt(0).toUpperCase() + name.slice(1)
}

module.exports = {
    createOrCleanDir,
    upperCaseFirstLatter,
}
